package enemies;

import java.awt.event.ActionEvent;
import java.util.ArrayList;
import javax.swing.Timer;

import Missiles.EnemyBomb;
import Missiles.Missile;

public class SuperEnemy extends StrongEnemy  //very powerful!
{	
	public SuperEnemy(int x, ArrayList<Missile> m)
	{	this(x, 0, m);	}
	
	public SuperEnemy(int x, int y, ArrayList<Missile> m)
	{
		super(x, y, m);
		damageHitPlayer = 5;
		maxHP = 9;
		hp = maxHP;
		dropRate = 0.6; //higher dropRate
		enemyMissiles = m;
        setImage(SUPER_ENEMY);
	}
	
	public void actionPerformed(ActionEvent e)
	{
		if (Math.random() < 0.3) super.actionPerformed(e); //30% possibility to fire normal enemy missile
		else {
			double angle = Math.random() * Math.PI/3 - Math.PI/6;
			enemyMissiles.add(new EnemyBomb(getX() + width/2, getY() + height, angle, false));
		}
	}
}